package com.ruoyi.common.utils;

/**
 * 根据文件后缀名获取对应返回格式
 *
 * @Author： zxn
 */

public class ContentTypeUtil {

    public static String MimeType(String type) {

        switch (type) {
            case "doc":
            case "docx":
                return "application/msword";
            case "jpg":
            case "jpe":
            case "jpeg":
                return "image/jpeg";
            case "ppt":
                return "application/vnd.ms-powerpoint";
            case "xml":
                return "text/xml";
            case "txt":
                return "text/plain";
            case "pdf":
                return "application/pdf";
            case "xlsx":
            case "xls":
                return "application/vnd.ms-excel";
            case "png":
                return "image/png";
        }
        return "";
    }


}
